Assign the size of the screen to the root window
authorKristian Rietveld <kris@gtk.org>
Tue, 15 Sep 2009 09:04:50 +0000 (11:04 +0200)
committerKristian Rietveld <kris@gtk.org>
Wed, 16 Sep 2009 06:48:49 +0000 (08:48 +0200)
On startup, the root window got assigned the size of the main screen.
But, the GdkScreen has the width of all screens/monitors connected to the
machine.  Change this so that in _gdk_windowing_window_init, we assign
the width/height of all monitors to the root window width, height.
Should fix bug 594738.

gdk/quartz/gdkwindow-quartz.c

index 6b8373b2b9539535f9dc5602c9815517caa16cda..a7aaf916c2e219f285c55c9402b17f0608bd1b07 100644 (file)
@@ -955,16 +955,20 @@ _gdk_windowing_window_init (void)
   private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
   private->impl_window = private;
 
-  /* Note: This needs to be reworked for multi-screen support. */
   impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (_gdk_root)->impl);
-  rect = [[NSScreen mainScreen] frame];
 
+  /* The size of the root window should be the same as the size of
+   * the screen it belongs to.
+   *
+   * FIXME: Of course this needs to be updated when you change the monitor
+   * configuration (add another one, remove one, etc).
+   */
   private->x = 0;
   private->y = 0;
   private->abs_x = 0;
   private->abs_y = 0;
-  private->width = rect.size.width;
-  private->height = rect.size.height;
+  private->width = gdk_screen_get_width (_gdk_screen);
+  private->height = gdk_screen_get_height (_gdk_screen);
 
   private->state = 0; /* We don't want GDK_WINDOW_STATE_WITHDRAWN here */
   private->window_type = GDK_WINDOW_ROOT;